<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>OpenLayers v8.2.0 API - Module: ol/interaction/Draw</title>
    <script src="scripts/prettify/prettify.js"></script>
    <script src="scripts/prettify/lang-css.js"></script>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.bundle.min.js"
        crossorigin="anonymous"></script>
    <link rel="stylesheet" type="text/css"
        href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css" crossorigin="anonymous">
    <link rel="stylesheet" type="text/css"
        href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1.2/css/fontawesome.min.css"
        crossorigin="anonymous">
    <link rel="stylesheet" type="text/css"
        href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1.2/css/solid.css" crossorigin="anonymous">
    <link rel="stylesheet" type="text/css"
        href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1.2/css/brands.css" crossorigin="anonymous">
    <link rel="stylesheet" type="text/css" href="styles/prettify-tomorrow.css">
    <link rel="stylesheet" type="text/css" href="styles/jaguar.css">
    <link rel="stylesheet" type="text/css" href="styles/carbon.css">
    <link rel="stylesheet" type="text/css" href="/theme/ol.css">
    <link rel="stylesheet" type="text/css" href="/theme/site.css">
</head>

<body>
    <header class="navbar navbar-expand-sm navbar-dark mb-3 px-3 py-0 fixed-top" role="navigation">
        <a class="navbar-brand" href="/"><img src="/theme/img/logo-dark.svg" width="70" height="70"
                alt="">&nbsp;OpenLayers</a>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#olmenu"
            aria-controls="olmenu" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>

        <!-- menu items that get hidden below 768px width -->
        <nav class="collapse navbar-collapse" id="olmenu">
            <ul class="nav navbar-nav ms-auto">
                <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" href="#" id="docdropdown" role="button"
                        data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Docs</a>
                    <div class="dropdown-menu dropdown-menu-end mb-3" aria-labelledby="docdropdown">
                        <a class="dropdown-item" href="/doc/">Docs</a>
                        <div class="dropdown-divider"></div>
                        <a class="dropdown-item" href="/doc/quickstart.html"><i
                                class="fa fa-check fa-fw me-2 fa-lg"></i>快速入门</a>
                        <a class="dropdown-item" href="/doc/faq.html"><i
                                class="fa fa-question fa-fw me-2 fa-lg"></i>FAQ</a>
                        <a class="dropdown-item" href="/doc/tutorials/"><i
                                class="fa fa-book fa-fw me-2 fa-lg"></i>Tutorials</a>
                        <div class="dropdown-divider"></div>
                        <a class="dropdown-item" href="https://stackoverflow.com/questions/tagged/openlayers"><i
                                class="fab fa-stack-overflow fa-fw me-2"></i>Ask a Question</a>
                    </div>
                </li>
                <li class="nav-item"><a class="nav-link" href="/en/latest/examples/">Examples</a></li>
                <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" href="#" id="apidropdown" role="button"
                        data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        <i class="fa fa-sitemap me-1"></i>API
                    </a>
                    <div class="dropdown-menu dropdown-menu-end mb-3" aria-labelledby="apidropdown">
                        <a class="dropdown-item" href="/en/latest/apidoc/"><i
                                class="fa fa-sitemap fa-fw me-2 fa-lg"></i>v8.2.0
                            (latest)</a </div>
                </li>
            </ul>
        </nav>
    </header>

    <div class="container-fluid">
        <div id="wrap" class="row">
            <div class="navigation col-md-4 col-lg-3">
                <div class="search-wrapper">
                    <div class="search">
                        <input id="search" type="text" autocomplete="off" class="form-control input-sm"
                            placeholder="Search Documentation">
                    </div>
                </div>
                <div class="navigation-list-wrapper">
                    <ul class="navigation-list search-empty">
                        <li class="item item-module toggle-manual toggle-manual-show"
                            data-longname="module:ol/interaction/Draw" data-name="ol/interaction/draw">
                            <span class="title toggle">
                                <span class="fa fa-plus me-2 mt-1"></span>
                                <span><a href="module-ol_interaction_Draw.html">ol​/interaction​/Draw</a></span>
                            </span>
                            <div class="member-list" data-type="typedefs">
                                <span class="subtitle">Typedefs</span>
                                <ul>
                                    <li data-name="geometryfunction"><a
                                            href="module-ol_interaction_Draw.html#~GeometryFunction">GeometryFunction</a>
                                    <li data-name="linecoordtype"><a
                                            href="module-ol_interaction_Draw.html#~LineCoordType">LineCoordType</a>
                                    <li data-name="mode"><a href="module-ol_interaction_Draw.html#~Mode">Mode</a>
                                    <li data-name="options"><a
                                            href="module-ol_interaction_Draw.html#~Options">Options</a>
                                    <li data-name="pointcoordtype"><a
                                            href="module-ol_interaction_Draw.html#~PointCoordType">PointCoordType</a>
                                    <li data-name="pointsegmentrelationship"><a
                                            href="module-ol_interaction_Draw.html#~PointSegmentRelationship">PointSegmentRelationship</a>
                                    <li data-name="polycoordtype"><a
                                            href="module-ol_interaction_Draw.html#~PolyCoordType">PolyCoordType</a>
                                    <li data-name="sketchcoordtype"><a
                                            href="module-ol_interaction_Draw.html#~SketchCoordType">SketchCoordType</a>
                                    <li data-name="tracestate"><a
                                            href="module-ol_interaction_Draw.html#~TraceState">TraceState</a>
                                    <li data-name="tracetarget"><a
                                            href="module-ol_interaction_Draw.html#~TraceTarget">TraceTarget</a>
                                    <li data-name="tracetargetupdateinfo"><a
                                            href="module-ol_interaction_Draw.html#~TraceTargetUpdateInfo">TraceTargetUpdateInfo</a>
                                </ul>
                            </div>
                            <div class="member-list" data-type="methods">
                                <span class="subtitle">Methods</span>
                                <ul>
                                    <li data-name="createbox"><a
                                            href="module-ol_interaction_Draw.html#.createBox">createBox</a>
                                    <li data-name="createregularpolygon"><a
                                            href="module-ol_interaction_Draw.html#.createRegularPolygon">createRegularPolygon</a>
                                </ul>
                            </div>
                        <li class="loading">Loading …
                    </ul>
                </div>
            </div>

            <div class="main col-md-8 col-lg-9">
                <h1 class="page-title" data-filename="module-ol_interaction_Draw.html">Module: ol/interaction/Draw</h1>
                <div id="latest-check" class="alert alert-warning alert-dismissible" role="alert" style="display:none">
                    <button id="latest-dismiss" type="button" class="btn-close" data-bs-dismiss="alert"
                        aria-label="Close"></button>
                    This documentation is for OpenLayers v<span id="package-version">8.2.0</span>. The <a
                        id="latest-link" href="#" class="alert-link">latest</a> is v<span id="latest-version"></span>.
                </div>




                <section class="content">

                    <header>
                        <h2 class="my-3">ol/interaction/Draw
                        </h2>
                        <br>




                        <div class="row p-3 ">
                            <!-- <div id="ad" class="col-lg-5 order-2 align-self-center border rounded bg-light ">
                                <script async type="text/javascript"
                                    src="https://cdn.carbonads.com/carbon.js?serve=CE7DV53U&placement=openlayersorg"
                                    id="_carbonads_js"></script>
                            </div> -->

                        </div>
                    </header>

                    <article>
                        <div class="container-overview">






                            <dl class="details">





















                            </dl>




                        </div>










                        <h3 class="subsection-title">Classes</h3>

                        <dl>
                            <dt><a href="module-ol_interaction_Draw.DrawEvent.html">DrawEvent</a></dt>
                            <dd></dd>

                            <dt><a href="module-ol_interaction_Draw-Draw.html">Draw</a></dt>
                            <dd></dd>
                        </dl>









                        <h3 class="subsection-title">Functions</h3>

                        <dl>


                            <dt class="">

                                <div class="nameContainer">
                                    <div class="anchor" id=".createBox">
                                    </div>
                                    <h4 class="name">
                                        createBox<span class="signature">()</span><span
                                            class="fa fa-arrow-circle-right"></span><span
                                            class="type-signature returnType">{<a
                                                href="module-ol_interaction_Draw.html#~GeometryFunction">GeometryFunction</a>}</span>



                                    </h4>

                                    <div class="tag-source">
                                        <a
                                            href="https://github.com/openlayers/openlayers/blob/v8.2.0/src/ol/interaction/Draw.js">interaction/Draw.js</a>,
                                        <a
                                            href="https://github.com/openlayers/openlayers/blob/v8.2.0/src/ol/interaction/Draw.js#L1914">line
                                            1914</a>
                                    </div>

                                </div>


                            </dt>
                            <dd class="">



                                <pre
                                    class="prettyprint source"><code>import {createBox} from 'ol/interaction/Draw';</code></pre>



                                <div class="description">
                                    <p>创建一个<code>几何函数(geometryFunction)</code>，用于创建一个矩形多边形（与坐标系轴对齐）。将此函数与绘制交互和类型：<code>'Circle'</code>一起使用，以返回矩形而不是圆形几何图形。
                                    </p>
                                </div>











                                <dl class="details">





















                                </dl>















                                <h5>Returns:</h5>
                                绘制矩形多边形的函数。
                                <br />




                            </dd>




                            <dt class="">

                                <div class="nameContainer">
                                    <div class="anchor" id=".createRegularPolygon">
                                    </div>
                                    <h4 class="name">
                                        createRegularPolygon<span class="signature">(<span
                                                class="optional">sides</span>, <span
                                                class="optional">angle</span>)</span><span
                                            class="fa fa-arrow-circle-right"></span><span
                                            class="type-signature returnType">{<a
                                                href="module-ol_interaction_Draw.html#~GeometryFunction">GeometryFunction</a>}</span>



                                    </h4>

                                    <div class="tag-source">
                                        <a
                                            href="https://github.com/openlayers/openlayers/blob/v8.2.0/src/ol/interaction/Draw.js">interaction/Draw.js</a>,
                                        <a
                                            href="https://github.com/openlayers/openlayers/blob/v8.2.0/src/ol/interaction/Draw.js#L1873">line
                                            1873</a>
                                    </div>

                                </div>


                            </dt>
                            <dd class="">



                                <pre
                                    class="prettyprint source"><code>import {createRegularPolygon} from 'ol/interaction/Draw';</code></pre>



                                <div class="description">
                                    <p>为类型<code>'Circle'</code>
                                        创建一个<code>geometryFunction</code>，该函数将创建一个具有用户指定边数和起始角度的正多边形，而不是<a
                                            href="module-ol_geom_Circle-Circle.html"><code>Circle</code></a>几何体。
                                    </p>
                                </div>










                                <table class="params">
                                    <thead>
                                        <tr>

                                            <th>Name</th>


                                            <th>Type</th>

                                            <th class="last">Description</th>
                                        </tr>
                                    </thead>

                                    <tbody>


                                        <tr class="">

                                            <td class="name"><code>sides</code></td>



                                            <td class="type">


                                                <span class="param-type">number</span>

                                                | undefined


                                            </td>



                                            <td class="description last">

                                                <p>正多边形的边数。默认为 32。</p>
                                            </td>
                                        </tr>



                                        <tr class="">

                                            <td class="name"><code>angle</code></td>



                                            <td class="type">


                                                <span class="param-type">number</span>

                                                | undefined


                                            </td>



                                            <td class="description last">

                                                <p>第一个点在逆时针方向上的弧度角。0 表示东方。默认为从正多边形的中心到当前指针位置的朝向所定义的角度。</p>
                                            </td>
                                        </tr>


                                    </tbody>
                                </table>




                                <dl class="details">





















                                </dl>















                                <h5>Returns:</h5>
                                Function that draws a polygon.
                                <br />




                            </dd>

                        </dl>



                        <h3 class="subsection-title">Type Definitions</h3>

                        <dl>

                            <dt class="">

                                <div class="nameContainer">
                                    <div class="anchor" id="~GeometryFunction">
                                    </div>
                                    <h4 class="name">
                                        GeometryFunction<span class="signature">()</span>



                                    </h4>

                                    <div class="tag-source">
                                        <a
                                            href="https://github.com/openlayers/openlayers/blob/v8.2.0/src/ol/interaction/Draw.js">interaction/Draw.js</a>,
                                        <a
                                            href="https://github.com/openlayers/openlayers/blob/v8.2.0/src/ol/interaction/Draw.js#L150">line
                                            150</a>
                                    </div>

                                </div>


                            </dt>
                            <dd class="">




                                <div class="description">
                                    <p>该函数接受一个坐标数组和一个可选的现有几何体以及投影作为参数，并返回一个几何体。当函数在没有第二个参数的情况下被调用时，返回的几何体是可选的现有几何体。</p>
                                </div>











                                <dl class="details">





















                                </dl>













                            </dd>



                            <dt class="">
                                <div class="nameContainer">
                                    <div class="anchor" id="~LineCoordType">
                                    </div>
                                    <h4 class="name">
                                        LineCoordType<span
                                            class="type-signature type array.<module:ol/coordinate~coordinate>">{Array&lt;<a
                                                href="module-ol_coordinate.html#~Coordinate">Coordinate</a>>}</span>


                                    </h4>
                                </div>

                            </dt>
                            <dd class="">

                                <div class="description">
                                    <p>绘制线条时的坐标类型。</p>
                                </div>



                                <dl class="details">





















                                </dl>



                            </dd>



                            <dt class="">
                                <div class="nameContainer">
                                    <div class="anchor" id="~Mode">
                                    </div>
                                    <h4 class="name">
                                        Mode<span class="type-signature type 'point'">{'Point'}</span> <span
                                            class="type-signature type 'linestring'">{'LineString'}</span> <span
                                            class="type-signature type 'polygon'">{'Polygon'}</span> <span
                                            class="type-signature type 'circle'">{'Circle'}</span>


                                    </h4>
                                </div>

                            </dt>
                            <dd class="">

                                <div class="description">
                                    <p>绘制模式。这将把多部分几何体类型与其单部分同类项合并。</p>
                                </div>



                                <dl class="details">





















                                </dl>



                            </dd>



                            <dt class="">
                                <div class="nameContainer">
                                    <div class="anchor" id="~Options">
                                    </div>
                                    <h4 class="name">
                                        Options<span class="type-signature type object">{Object}</span>


                                    </h4>
                                </div>

                            </dt>
                            <dd class="">



                                <dl class="details">


                                    <h5 class="subsection-title">Properties:</h5>

                                    <dl>

                                        <table class="props">
                                            <thead>
                                                <tr>

                                                    <th>Name</th>


                                                    <th>Type</th>

                                                    <th class="last">Description</th>
                                                </tr>
                                            </thead>

                                            <tbody>


                                                <tr>

                                                    <td class="name"><code>type</code></td>


                                                    <td class="type">


                                                        <span class="param-type"><a
                                                                href="module-ol_geom_Geometry.html#~Type">Type</a></span>




                                                    </td>

                                                    <td class="description last">
                                                        <p>用这个实例绘制的几何体的几何类型。</p>

                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>clickTolerance</code></td>


                                                    <td class="type">


                                                        <span class="param-type">number</span>



                                                        <br>(defaults to 6)


                                                    </td>

                                                    <td class="description last">
                                                        <p>“up”事件与“down”事件之间的最大像素距离，以便将“up”事件视为“click”事件，并将点/顶点添加到正在绘制的几何体中。选择默认值6是为了使绘制交互在鼠标和触摸设备上都能正确运行。
                                                        </p>

                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>features</code></td>


                                                    <td class="type">


                                                        <span class="param-type"><a
                                                                href="module-ol_Collection-Collection.html">Collection</a>&lt;<a
                                                                href="module-ol_Feature-Feature.html">Feature</a>></span>

                                                        | undefined


                                                    </td>

                                                    <td class="description last">
                                                        <p>绘制要素的目标集合。</p>

                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>source</code></td>


                                                    <td class="type">


                                                        <span class="param-type"><a
                                                                href="module-ol_source_Vector-VectorSource.html">VectorSource</a></span>

                                                        | undefined


                                                    </td>

                                                    <td class="description last">
                                                        <p>绘制要素的目标源。</p>

                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>dragVertexDelay</code></td>


                                                    <td class="type">


                                                        <span class="param-type">number</span>



                                                        <br>(defaults to 500)


                                                    </td>

                                                    <td class="description last">
                                                        <p>在将当前顶点拖动到其确切位置之前，指针向下延迟（以毫秒为单位）。
                                                        </p>

                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>snapTolerance</code></td>


                                                    <td class="type">


                                                        <span class="param-type">number</span>



                                                        <br>(defaults to 12)


                                                    </td>

                                                    <td class="description last">
                                                        <p>用于捕捉到绘图完成的像素距离。必须大于 <code>0</code>.</p>

                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>stopClick</code></td>


                                                    <td class="type">


                                                        <span class="param-type">boolean</span>



                                                        <br>(defaults to false)


                                                    </td>

                                                    <td class="description last">
                                                        <p>在绘图过程中停止触发单击、单击和双击事件。</p>

                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>maxPoints</code></td>


                                                    <td class="type">


                                                        <span class="param-type">number</span>

                                                        | undefined


                                                    </td>

                                                    <td class="description last">
                                                        <p>在完成多边形环或线串之前可以绘制的点数。默认情况下，没有限制。</p>

                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>minPoints</code></td>


                                                    <td class="type">


                                                        <span class="param-type">number</span>

                                                        | undefined


                                                    </td>

                                                    <td class="description last">
                                                        <p>在完成多边形环或线串之前必须绘制的点数。默认值适用于 3 多边形环和 2 线串。
                                                        </p>

                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>finishCondition</code></td>


                                                    <td class="type">


                                                        <span class="param-type"><a
                                                                href="module-ol_events_condition.html#~Condition">Condition</a></span>

                                                        | undefined


                                                    </td>

                                                    <td class="description last">
                                                        <p>一个函数，它接受 并<a
                                                                href="module-ol_MapBrowserEvent-MapBrowserEvent.html"><code>MapBrowserEvent</code></a>
                                                            返回一个布尔值，以指示绘图是否可以完成。在绘制 POINT 或 MULTI_POINT 几何图形时不使用。</p>

                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>style</code></td>


                                                    <td class="type">


                                                        <span class="param-type"><a
                                                                href="module-ol_style_Style.html#~StyleLike">StyleLike</a></span>
                                                        |

                                                        <span class="param-type"><a
                                                                href="module-ol_style_flat.html#~FlatStyleLike">FlatStyleLike</a></span>

                                                        | undefined


                                                    </td>

                                                    <td class="description last">
                                                        <p>草图特性的样式。根据模式，绘制交互可以最多有三个草图特性。它始终包含一个与当前光标位置相对应的具有点几何图形的特性。如果模式是<code>LineString</code>
                                                            or <code>Polygon</code>,
                                                            并且至少绘制了一个点，则它还将包含一个具有 <code>LineString</code>
                                                            几何图形的特性，该特性对应于已绘制点之间和当前光标位置之间的线。如果模式是<code>Polygon</code>，并且至少绘制了一个点，则它还将包含一个具有
                                                            <code>Polygon</code>几何图形的特性，该特性对应于已绘制点和当前光标位置之间的多边形（请注意，如果仅绘制了一个点，则此多边形只有两个点）。如果模式是<code>Circle</code>,
                                                            并且绘制了一个点，则它还将包含一个具有<code>Circle</code>几何图形的特性，其中心是绘制的点，半径由绘制的点和光标之间的距离确定。
                                                        </p>

                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>geometryFunction</code></td>


                                                    <td class="type">


                                                        <span class="param-type"><a
                                                                href="module-ol_interaction_Draw.html#~GeometryFunction">GeometryFunction</a></span>

                                                        | undefined


                                                    </td>

                                                    <td class="description last">
                                                        <p>更新几何坐标时调用的函数。</p>

                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>geometryName</code></td>


                                                    <td class="type">


                                                        <span class="param-type">string</span>

                                                        | undefined


                                                    </td>

                                                    <td class="description last">
                                                        <p>用于绘制交互创建的特征的几何名称。</p>
                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>condition</code></td>


                                                    <td class="type">


                                                        <span class="param-type"><a
                                                                href="module-ol_events_condition.html#~Condition">Condition</a></span>

                                                        | undefined


                                                    </td>

                                                    <td class="description last">
                                                        <p>一个函数，它接受 <a
                                                                href="module-ol_MapBrowserEvent-MapBrowserEvent.html"><code>MapBrowserEvent</code></a>并返回一个布尔值，以指示是否应处理该事件。默认情况下<a
                                                                href="module-ol_events_condition.html#.noModifierKeys"><code>noModifierKeys</code></a>，即单击、添加顶点或停用手绘。
                                                        </p>

                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>freehand</code></td>


                                                    <td class="type">


                                                        <span class="param-type">boolean</span>



                                                        <br>(defaults to false)


                                                    </td>

                                                    <td class="description last">
                                                        <p>在手绘模式下对线、多边形和圆进行操作。这使得交互始终以徒手模式运行，并优先于任何
                                                            <code>freehandCondition</code>选项。
                                                        </p>

                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>freehandCondition</code></td>


                                                    <td class="type">


                                                        <span class="param-type"><a
                                                                href="module-ol_events_condition.html#~Condition">Condition</a></span>

                                                        | undefined


                                                    </td>

                                                    <td class="description last">
                                                        <p>激活线条和多边形的手绘条件。此函数接受<a
                                                                href="module-ol_MapBrowserEvent-MapBrowserEvent.html"><code>MapBrowserEvent</code></a>
                                                            并返回一个布尔值，以指示是否应处理该事件。默认值为<a
                                                                href="module-ol_events_condition.html#.shiftKeyOnly"><code>shiftKeyOnly</code></a>，表示
                                                            Shift 键激活手绘。</p>

                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>trace</code></td>


                                                    <td class="type">


                                                        <span class="param-type">boolean</span>
                                                        |

                                                        <span class="param-type"><a
                                                                href="module-ol_events_condition.html#~Condition">Condition</a></span>



                                                        <br>(defaults to false)


                                                    </td>

                                                    <td class="description last">
                                                        <p>描摹另一个几何图形的一部分。在徒手模式下被忽略。</p>

                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>traceSource</code></td>


                                                    <td class="type">


                                                        <span class="param-type"><a
                                                                href="module-ol_source_Vector-VectorSource.html">VectorSource</a></span>

                                                        | undefined


                                                    </td>

                                                    <td class="description last">
                                                        <p>要追踪的特征的来源。如果跟踪处于活动状态且未提供
                                                            a<code>traceSource</code>,<code>source</code>则将使用交互。跟踪要求使用<code>traceSource</code>
                                                            或<code>source</code>.
                                                        </p>
                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>wrapX</code></td>


                                                    <td class="type">


                                                        <span class="param-type">boolean</span>



                                                        <br>(defaults to false)


                                                    </td>

                                                    <td class="description last">
                                                        <p>将世界水平包裹在草图叠加上。</p>

                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>geometryLayout</code></td>


                                                    <td class="type">


                                                        <span class="param-type"><a
                                                                href="module-ol_geom_Geometry.html#~GeometryLayout">GeometryLayout</a></span>



                                                        <br>(defaults to 'XY')


                                                    </td>

                                                    <td class="description last">
                                                        <p>由绘制交互创建的特征几何的布局。</p>

                                                    </td>
                                                </tr>


                                            </tbody>
                                        </table>
                                    </dl>






















                                </dl>



                            </dd>



                            <dt class="">
                                <div class="nameContainer">
                                    <div class="anchor" id="~PointCoordType">
                                    </div>
                                    <h4 class="name">
                                        PointCoordType<span
                                            class="type-signature type module:ol/coordinate~coordinate">{<a
                                                href="module-ol_coordinate.html#~Coordinate">Coordinate</a>}</span>


                                    </h4>
                                </div>

                            </dt>
                            <dd class="">

                                <div class="description">
                                    <p>绘制点时的坐标类型。</p>
                                </div>



                                <dl class="details">





















                                </dl>



                            </dd>



                            <dt class="">
                                <div class="nameContainer">
                                    <div class="anchor" id="~PointSegmentRelationship">
                                    </div>
                                    <h4 class="name">
                                        PointSegmentRelationship<span class="type-signature type object">{Object}</span>


                                    </h4>
                                </div>

                            </dt>
                            <dd class="">



                                <dl class="details">


                                    <h5 class="subsection-title">Properties:</h5>

                                    <dl>

                                        <table class="props">
                                            <thead>
                                                <tr>

                                                    <th>Name</th>


                                                    <th>Type</th>

                                                    <th class="last">Description</th>
                                                </tr>
                                            </thead>

                                            <tbody>


                                                <tr>

                                                    <td class="name"><code>along</code></td>


                                                    <td class="type">


                                                        <span class="param-type">number</span>




                                                    </td>

                                                    <td class="description last">
                                                        <p>沿线段长度表示的最接近点的分数。</p>

                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>squaredDistance</code></td>


                                                    <td class="type">


                                                        <span class="param-type">number</span>




                                                    </td>

                                                    <td class="description last">
                                                        <p>点到线段的平方距离。</p>

                                                    </td>
                                                </tr>


                                            </tbody>
                                        </table>
                                    </dl>






















                                </dl>



                            </dd>



                            <dt class="">
                                <div class="nameContainer">
                                    <div class="anchor" id="~PolyCoordType">
                                    </div>
                                    <h4 class="name">
                                        PolyCoordType<span
                                            class="type-signature type array.<array.<module:ol/coordinate~coordinate>>">{Array&lt;Array&lt;<a
                                                href="module-ol_coordinate.html#~Coordinate">Coordinate</a>>>}</span>


                                    </h4>
                                </div>

                            </dt>
                            <dd class="">

                                <div class="description">
                                    <p>绘制多边形时的坐标类型。</p>
                                </div>



                                <dl class="details">





















                                </dl>



                            </dd>



                            <dt class="">
                                <div class="nameContainer">
                                    <div class="anchor" id="~SketchCoordType">
                                    </div>
                                    <h4 class="name">
                                        SketchCoordType<span
                                            class="type-signature type module:ol/interaction/draw~pointcoordtype">{<a
                                                href="module-ol_interaction_Draw.html#~PointCoordType">PointCoordType</a>}</span>
                                        <span class="type-signature type module:ol/interaction/draw~linecoordtype">{<a
                                                href="module-ol_interaction_Draw.html#~LineCoordType">LineCoordType</a>}</span>
                                        <span class="type-signature type module:ol/interaction/draw~polycoordtype">{<a
                                                href="module-ol_interaction_Draw.html#~PolyCoordType">PolyCoordType</a>}</span>


                                    </h4>
                                </div>

                            </dt>
                            <dd class="">

                                <div class="description">
                                    <p>用于绘制坐标的类型。</p>
                                </div>



                                <dl class="details">





















                                </dl>



                            </dd>



                            <dt class="">
                                <div class="nameContainer">
                                    <div class="anchor" id="~TraceState">
                                    </div>
                                    <h4 class="name">
                                        TraceState<span class="type-signature type object">{Object}</span>


                                    </h4>
                                </div>

                            </dt>
                            <dd class="">



                                <dl class="details">


                                    <h5 class="subsection-title">Properties:</h5>

                                    <dl>

                                        <table class="props">
                                            <thead>
                                                <tr>

                                                    <th>Name</th>


                                                    <th>Type</th>

                                                    <th class="last">Description</th>
                                                </tr>
                                            </thead>

                                            <tbody>


                                                <tr>

                                                    <td class="name"><code>active</code></td>


                                                    <td class="type">


                                                        <span class="param-type">boolean</span>




                                                    </td>

                                                    <td class="description last">
                                                        <p>追踪活动。</p>

                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>startPx</code></td>


                                                    <td class="type">


                                                        <span class="param-type"><a
                                                                href="module-ol_pixel.html#~Pixel">Pixel</a></span>

                                                        | undefined


                                                    </td>

                                                    <td class="description last">
                                                        <p>最初点击的像素位置。</p>

                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>targets</code></td>


                                                    <td class="type">


                                                        <span class="param-type">Array&lt;<a
                                                                href="module-ol_interaction_Draw.html#~TraceTarget">TraceTarget</a>></span>

                                                        | undefined


                                                    </td>

                                                    <td class="description last">
                                                        <p>可用于追踪的目标。</p>

                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>targetIndex</code></td>


                                                    <td class="type">


                                                        <span class="param-type">number</span>

                                                        | undefined


                                                    </td>

                                                    <td class="description last">
                                                        <p>当前追踪的目标索引。值为 -1 表示没有激活的追踪目标。</p>

                                                    </td>
                                                </tr>


                                            </tbody>
                                        </table>
                                    </dl>






















                                </dl>



                            </dd>



                            <dt class="">
                                <div class="nameContainer">
                                    <div class="anchor" id="~TraceTarget">
                                    </div>
                                    <h4 class="name">
                                        TraceTarget<span class="type-signature type object">{Object}</span>


                                    </h4>
                                </div>

                            </dt>
                            <dd class="">



                                <dl class="details">


                                    <h5 class="subsection-title">Properties:</h5>

                                    <dl>

                                        <table class="props">
                                            <thead>
                                                <tr>

                                                    <th>Name</th>


                                                    <th>Type</th>

                                                    <th class="last">Description</th>
                                                </tr>
                                            </thead>

                                            <tbody>


                                                <tr>

                                                    <td class="name"><code>coordinates</code></td>


                                                    <td class="type">


                                                        <span class="param-type">Array&lt;<a
                                                                href="module-ol_coordinate.html#~Coordinate">Coordinate</a>></span>




                                                    </td>

                                                    <td class="description last">
                                                        <p>目标坐标。</p>

                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>ring</code></td>


                                                    <td class="type">


                                                        <span class="param-type">boolean</span>




                                                    </td>

                                                    <td class="description last">
                                                        <p>目标坐标是一个线性环。</p>

                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>startIndex</code></td>


                                                    <td class="type">


                                                        <span class="param-type">number</span>




                                                    </td>

                                                    <td class="description last">
                                                        <p>第一个追踪坐标的索引。分数索引表示边交点。对于环，索引值将循环（可能为负数或大于坐标长度）。</p>

                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>endIndex</code></td>


                                                    <td class="type">


                                                        <span class="param-type">number</span>




                                                    </td>

                                                    <td class="description last">
                                                        <p>最后一个追踪坐标的索引。关于 startIndex 的细节也适用于此。</p>

                                                    </td>
                                                </tr>


                                            </tbody>
                                        </table>
                                    </dl>






















                                </dl>



                            </dd>



                            <dt class="">
                                <div class="nameContainer">
                                    <div class="anchor" id="~TraceTargetUpdateInfo">
                                    </div>
                                    <h4 class="name">
                                        TraceTargetUpdateInfo<span class="type-signature type object">{Object}</span>


                                    </h4>
                                </div>

                            </dt>
                            <dd class="">



                                <dl class="details">


                                    <h5 class="subsection-title">Properties:</h5>

                                    <dl>

                                        <table class="props">
                                            <thead>
                                                <tr>

                                                    <th>Name</th>


                                                    <th>Type</th>

                                                    <th class="last">Description</th>
                                                </tr>
                                            </thead>

                                            <tbody>


                                                <tr>

                                                    <td class="name"><code>index</code></td>


                                                    <td class="type">


                                                        <span class="param-type">number</span>




                                                    </td>

                                                    <td class="description last">
                                                        <p>新的目标索引。</p>

                                                    </td>
                                                </tr>



                                                <tr>

                                                    <td class="name"><code>endIndex</code></td>


                                                    <td class="type">


                                                        <span class="param-type">number</span>




                                                    </td>

                                                    <td class="description last">
                                                        <p>新的线段结束索引。</p>

                                                    </td>
                                                </tr>


                                            </tbody>
                                        </table>
                                    </dl>






















                                </dl>



                            </dd>

                        </dl>



                    </article>

                </section>




            </div>
        </div>
    </div>
    <script>prettyPrint();</script>
    <script src="scripts/linenumber.js"></script>
    <script src="scripts/main.js"></script>
</body>

</html>